import java.util.Random;

/**
 * Created with IntelliJ IDEA.
 * Description :
 * User: $ {USER}
 * Date: $ {YEAR}-$ {MONTH}一$ { DAY}
 * Time: ${ TIME}
 */
/*
public class Test {
    public static void main(String[] args) {
        Student student = new Student();//定义一个Student的变量
        //初始化
        student.name = "张三";
        student.age = 18;
        student.func();


        */
/*//*
/ 生成一个[0,1)的浮点数 *10之后就变成了[0~,10)的浮点数，最后强制类型转换为int
        int  num = (int)(Math.random()*10);//生成一个随机数范围是0~9
        System.out.println(num);*//*


    }
}

class Student{
    String name;
    int age;

    public void func(){
        System.out.println("姓名："+name+" 年龄："+age);
    }
}*/


public class Test{
    public static void main(String[] args) {
        //实例化三个对象
        Date date1 = new Date();
        Date date2 = new Date();
        Date date3 = new Date();

        //设置时间
        date1.SetDate(2024,3,25);
        date2.SetDate(2024,3,26);
        date3.SetDate(2024,3,27);

        //打印结果，看看是否设置成功
        date1.PrintDate();
        date2.PrintDate();
        date3.PrintDate();
    }
}

/*
class Date{
    //属性
    public int year;
    public int month;
    public int day;

    //方法
    public void SetDate(int y, int m, int d){
        year = y;
        month = m;
        day = d;
    }
    public void PrintDate(){
        System.out.println(year+"/"+month+"/"+day);
    }

}*/


class Date{
    //属性
    public int year;
    public int month;
    public int day;

    //方法
    public void SetDate(int year, int month, int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void PrintDate(){
        System.out.println(this.year+"/"+this.month+"/"+this.day);
    }

}
